package cn.mysite.mycompany.service.impl;

import cn.mysite.mycompany.entity.Product;
import cn.mysite.mycompany.mapper.ProductMapper;
import cn.mysite.mycompany.service.ProductService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author  ChenChongFei
 * @since 2021-03-13
 */
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService {
    @Autowired
    private ProductMapper productMapper;

    @Override
    public List<Product> findByCategoryId(String type, Integer id) {
        Map<String,Object> map=new HashedMap();
        map.put("categorylevel"+type+"_id",id);
        return productMapper.selectByMap(map);

    }
}
